<fieldset>
    <legend>Add Misc. Cost</legend>
    <form method="post" action="{{$base_index_url}}/{{$current_module}}/admin/{{$current_controller}}/add_misc_cost" onsubmit="$.blockUI();">
        Description<input type="text" name="misc_desc" />
        Amount <input type="text" name="misc_amount" size="2" />

        <input type="submit" value="Add Cost"/>
        <input type="hidden" name="order_id" value="{{$order->id}}"/>
    </form>
</fieldset>
{{if $order->DYN_misc_costs<>""}}
<fieldset>
    <legend>Current Misc.(extra/other) Costs</legend>
    
    <table id="table">
        <tr>
            <th>Description</th>
            <th style="text-align: right">Amount</th>
            <th style="text-align: center">Action</th>
        </tr>
        {{foreach from=$order->DYN_misc_costs item=cost}}
        <tr class="table_row">
            <td style="width: 20%">
                {{$cost->cost_desc}}
            </td>
            <td style="text-align: right;">
                ${{$cost->amount}}                
            </td>
            <td style="text-align: center">
                <form name="m_{{$cost->id}}" id="m_{{$cost->id}}" method="post" action="{{$base_index_url}}/{{$current_module}}/admin/{{$current_controller}}/delete_misc_cost" >
                    <input type="hidden" name="misc_id" value="{{$cost->id}}" />
                    <input type="hidden" name="order_id" value="{{$order->id}}" />
                </form>
                <button onclick="delete_misc_cost('m_{{$cost->id}}');" >Delete</button>
            </td>
        </tr>
        {{/foreach}}
    </table>
</fieldset>
<script type="text/javascript">
    function delete_misc_cost(mid){
        if(confirm('You sure you want to delete this misc./extra cost ?')){
            $.blockUI();
            document.forms[mid].submit()
        }
    }
</script>
{{else}}
{{/if}}